/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 30318
 * Date: 2024-02-03
 * Time: 11:25
 */
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入第一个20位整数：");
        String s1 = scanner.nextLine();
        System.out.println("请输入第二个20位整数：");
        String s2 = scanner.nextLine();

        int[] sum = new int[21]; // 确保sum[20]初始值为0
        int carry = 0;

        for (int i = 19; i >= 0; i--) {
            int num1 = s1.charAt(i) - '0'; // 将字符转换为数字
            int num2 = s2.charAt(i) - '0';
            int t = num1 + num2 + carry;
            sum[i + 1] = t % 10;
            carry = t / 10;
        }
        sum[0] = carry; // 处理最高位的进位

        System.out.print("求和结果为：\n");
        if (sum[0] == 0) { // 所求结果最大位数为0
            for (int i = 1; i <= 20; i++) {
                System.out.print(sum[i]);
            }
        } else {
            for (int i = 0; i <= 20; i++) {
                System.out.print(sum[i]);
            }
        }
        System.out.println();
    }
}